package com.sike.netty.jinjie.bytebuf.reference;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;

public class ReferenceCountedTest_01 {
    public static void main(String[] args) {
        ByteBuf byteBuf = ByteBufAllocator.DEFAULT.buffer();
        System.out.println("refCnt = " + byteBuf.refCnt());

        byteBuf.retain();
        System.out.println("refCnt = " + byteBuf.refCnt());

        byteBuf.release();
        System.out.println("refCnt = " + byteBuf.refCnt());

        byteBuf.writeByte(1);
    }
}
